export default {
    namespaced:'countAbout',
    actions:{
        jiaOdd(context,value){
            if(context.state.sum % 2 !== 0){
                context.commit('JIA',value)
            }
        },
        jiaWait(context,value){
            setTimeout(() => {
                context.commit('JIA',value)
            }, 500);
            
        },
    },
    mutations:{
        JIA(state,value){
            console.log('mutations被调用了',state,value)
            state.sum += value
        },
        JIAN(state,value){
            state.sum -= value
        },
    },
    state:{
        sum:0,
        school:'尚硅谷',
        subject:'Vue',
    },
    getters:{
        bigSum(state){
            return state.sum*10
        }
    }
}